#include<stdio.h>
#include "linklist.h"

int main(int argc, char const *argv[])
{
    int n;
    scanf("%d", &n);

    linklist head = init_list();

    for(int i=1; i<=n; i++)
    {
        head = list_add_tail(head, new_node(i));
        show_list(head);
    }
    printf("剩下的两个幸存者是:\n");
    show_list(Josephus(head));
    return 0;
}
